﻿using _0016.Gonggong.Models;
using Prism.Mvvm;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _0016.ViewModels
{
    public class IndexViewModel : BindableBase
    {
        public IndexViewModel()
        {
            TaskBars = new ObservableCollection<TaskBar>();
            CreateTaskBars();
            CreateTestData();
        }
  
        private ObservableCollection<TaskBar> taskBars;

        public ObservableCollection<TaskBar> TaskBars
        {
            get { return taskBars; }
            set { taskBars = value;RaisePropertyChanged(); }
        }
        private ObservableCollection<DaiTODo> daiTODos;

        public ObservableCollection<DaiTODo> DaiTODos
        {
            get { return daiTODos; }
            set { daiTODos = value; RaisePropertyChanged(); }
        }
        private ObservableCollection<BeiWlu> beiWlus;

        public ObservableCollection<BeiWlu> BeiWlus
        {
            get { return beiWlus; }
            set { beiWlus = value; RaisePropertyChanged(); }
        }
        void CreateTaskBars()
        {
            taskBars.Add(new TaskBar() { Tubiao = "ClockFast", Title = "汇总", Neirong = "9", Color = "#FF0CA0FF", Target = "" });
            taskBars.Add(new TaskBar() { Tubiao = "ClockCheckOutline", Title = "已完成", Neirong = "9", Color = "#FF0CA0FF", Target = "" });
            taskBars.Add(new TaskBar() { Tubiao = "ChartLineVariant", Title = "完成比例", Neirong = "100%", Color = "#FF0CA0FF", Target = "" });
            taskBars.Add(new TaskBar() { Tubiao = "PlaylistStar", Title = "备忘录", Neirong = "19", Color = "#FF0CA0FF", Target = "" });
        }
        void CreateTestData()
        {
            DaiTODos = new ObservableCollection<DaiTODo>();
            BeiWlus = new ObservableCollection<BeiWlu>();
            for (int i = 0; i < 10; i++)
            {
                DaiTODos.Add(new DaiTODo(){ Title="待办"+i, Neirong="正在处理...."});
                BeiWlus.Add(new BeiWlu() { Title = "备忘"+i, Neirong = "我的密码" });
            }
        }
    }
}
